package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IWorkerCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("workerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 实名认证相关接口")
public class WorkerCertificationController {
    @Resource
    private IWorkerCertificationService workerCertificationService;

    @PostMapping
    @ApiOperation("服务端提交实名认证申请")
    public void applyCertification(@RequestBody WorkerCertificationAuditAddReqDTO certiAddReqDTO){
        workerCertificationService.apply(certiAddReqDTO);
    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public RejectReasonResDTO getRejectReason(){
        RejectReasonResDTO reason= workerCertificationService.getRejectReason();
        return reason;
    }
}
